1. Field of the Invention
The present invention relates to a semiconductor device which controls to drive an inductive load such as an AC motor or the like, and in particular relates to a semiconductor device which is equipped with a function of detecting the current which flows through an inductive load.
2. Description of the Related Art
With a semiconductor device which controls to drive an inductive load such as an AC motor or the like, in order to control the current which flows through the inductive load (hereinafter termed the xe2x80x9cload currentxe2x80x9d), it is necessary to detect the value of this load current. In Japanese Laid-Open Patent Publication No. 2001-16865, there is disclosed a method for detecting such a load current using a current sensor. However, it is not possible to satisfy demands for reduction in the cost and the size of such a semiconductor device, since generally the cost of a current sensor is high, and moreover its size cannot be ignored.
Furthermore, in FIG. 7 of the above identified publication NO. 2001-16865, a method is disclosed of detecting the load current by using current mirrors of several power transistors which make up an inverter device. FIG. 7 of this application is a figure showing a circuit for one phase of an inverter device based upon this prior art method. IGBT (Insulated Gate Bipolar Transistor) 1 through IGBT 4 are used as the power transistors, and IGBT 3 is a current mirror for IGBT 1, while IGBT 4 is a current mirror for IGBT 2. The current which flows in IGBT 3 and IGBT 4 can be detected by current detectors 5 and 6. These current detectors 5 and 6 comprise respective resistors for current detection R1 and R2 and operational amplifiers (hereinafter termed the xe2x80x9cop-ampxe2x80x9d) 5a and 6a. The current which flows in IGBT 3 and IGBT 4 is detected respectively by detecting the electric potential difference between the ends of the resistors R1, R2 with the op-amp circuits 5a and 6a. 
With the circuit shown in FIG. 7, in the state in which the upper side IGBT 1 and IGBT 3 are OFF, and when IGBT 2 and IGBT 4 are respectively ON, the load current flows in the IGBT 2 and IGBT 4 in the directions shown by the arrows Y3 and Y4 respectively. Since the current which flows in the IGBT 4 is proportional to the current which is flowing in the IGBT 2, it is possible to detect the current which flows in the IGBT 2 and the IGBT 4, in other words the load current, by detecting the current which flows in the IGBT 4 with the current detector 6.
However, the following problems are present with the method of detecting the load current by using the circuit shown in FIG. 7. In detail, when the load current flows in the direction shown by the arrow Y3 and Y4 and when the lower side IGBT 2 and IGBT 4 are turned OFF, the load current flows through a free wheel diode D1. Next, when the lower side IGBT 2 and IGBT 4 go to ON, the load current again flows in the directions shown by the arrows Y3 and Y4. Since a reverse recovery current flows in the direction shown by the arrow Y2 during the reverse recovery period of the free wheel diode D1, it may happen that such a reverse recovery current in addition to the load current flow in IGBT 2 and IGBT 4. Accordingly, the current detected by the current detector 6 is not proportional to the current which flows in the load 30, and it becomes impossible to measure the load current accurately.
It would be desirable to provide a semiconductor device equipped with a current detection function, which is capable of detecting the current which flows in an inductive load accurately.
A semiconductor device equipped with a current detection function according to the present invention comprises a first power transistor which is positioned in an upper arm side with respect to an inductive load and which supplies drive current in a first direction, a first current adjustment device which causes current to flow in the direction opposite to the first direction with respect to the first power transistor, a first current mirror circuit through which flows a current proportional to the current which flows in the first power transistor, a first current detection device which detects the current flowing in the opposite direction in the first current mirror circuit, a second power transistor, connected in series with the first power transistor which is positioned in a lower arm side with respect to the inductive load and which supplies drive current in a second direction which is different from the first direction, a second current adjustment device which causes current to flow the direction opposite to the second direction with respect to the second power transistor, a second current mirror circuit through which flows a current proportional to the current which flows in the second power transistor, a second current detection device which detects the current flowing in the opposite direction in the second current mirror circuit and a drive device which drives the first power transistor and the second power transistor. In this semiconductor device equipped with a current detection function, a current which is flowing in the inductive load is detected based upon a reverse direction current which is detected by at least one of the first current detection device and the second current detection device while the first power transistor and the second power transistor are both being controlled to be OFF by the drive device.